package com.hl.mapper;

import com.hl.pojo.Announcement;
import com.hl.pojo.Company;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AnnouncementMapper {
    @Insert("insert into announcement (announcement_name, announcement_content, publish_time) value (#{announcementName},#{announcementContent},#{publishTime})")
    Integer add(Announcement announcement);
    @Select("select * from announcement where del = 0")
    List<Announcement> findAll(Announcement announcement);
    @Update("update announcement set del = 1 where id = #{id}")
    Integer del(Integer id);
    @Update("update announcement set announcement_name = #{announcementName}, announcement_content = #{announcementContent} where id = #{id}")
    Integer update(Announcement announcement);
    @Select("select * from announcement a where a.announcement_name LIKE CONCAT('%', #{name}, '%') and del != 1")
    public List<Announcement> findAll2(@Param("name") String name);
}
